Skip to content

test(ci): add unit-test seam for lint-composite-actions.mjs#7494

Closed
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:chore/lint-composite-actions-test-seam-7459
Closed

test(ci): add unit-test seam for lint-composite-actions.mjs#7494
lourincedaging0-commits wants to merge 1 commit into
JSONbored:mainfrom
lourincedaging0-commits:chore/lint-composite-actions-test-seam-7459

Conversation

@lourincedaging0-commits

Copy link
Copy Markdown
Contributor

Closes #7459

What

lint-composite-actions.mjs's findActionFiles, JSON-schema validation, and the composite-only "every run: step needs an explicit shell:" check only ran inside the disk-reading / process.exit driver — none was testable in isolation.

  • Extracts compileActionSchema, findActionFiles (with readdir/readFile injected), validateActionFile (pure: path + YAML text + a compiled validator → error lines), and a runLint driver returning the exit code.
  • Gates the schema-load + actions-tree disk reads behind import.meta.url === pathToFileURL(process.argv[1]).href. Direct invocation is unchanged.
  • Adds scripts/lint-composite-actions.d.mts and test/unit/lint-composite-actions-script.test.ts.

Tests (green locally under vitest run test/unit, against the real vendored schema)

  • A composite run: step missing shell: is flagged with its exact runs.steps[i] ("name").
  • A schema violation (an action with no runs block) is flagged.
  • A well-formed composite action whose run: steps all carry a shell: passes cleanly.
  • A subdirectory with neither action.yml nor action.yaml is silently skipped.
  • The "no action files found" early-exit returns 0.

Verified: importing makes no disk/network access; the typed .mjs import resolves via the .d.mts (no TS7016). scripts/** isn't in coverage.include.

findActionFiles, the JSON-schema validation, and the composite-only shell:-presence check
only ran inside the disk-reading / process.exit driver, so none was testable in isolation.

Extract compileActionSchema, findActionFiles (readdir/readFile injected), validateActionFile
(pure: takes path + YAML text + a compiled validator), and a runLint driver returning an exit
code; gate the schema/actions-tree disk reads behind import.meta.url === argv[1]. Add
scripts/lint-composite-actions.d.mts and test/unit/lint-composite-actions-script.test.ts
covering: a run: step missing shell: is flagged with its exact index/name; a schema violation
is flagged; a well-formed composite action passes; a subdir with no action.yml/.yaml is
silently skipped; and the no-files early-exit. Validates against the real vendored schema.
Direct-invocation behavior is unchanged.

Closes JSONbored#7459
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.41%. Comparing base (a3f2baa) to head (bdeb200).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7494   +/-   ##
=======================================
  Coverage   91.41%   91.41%           
=======================================
  Files         717      717           
  Lines       73035    73035           
  Branches    21635    21635           
=======================================
  Hits        66765    66765           
  Misses       5227     5227           
  Partials     1043     1043           
Flag Coverage Δ
shard-1 33.69% <ø> (+1.28%) ⬆️
shard-2 38.75% <ø> (+3.36%) ⬆️
shard-3 28.89% <ø> (-2.92%) ⬇️
shard-4 39.09% <ø> (-4.56%) ⬇️
shard-5 37.32% <ø> (+0.13%) ⬆️
shard-6 37.20% <ø> (+1.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 20, 2026
@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-20 13:17:49 UTC

3 files · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

  • AI review already in progress for this PR head: Another LoopOver pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another LoopOver pass. LoopOver is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.

CI checks failing

  • validate
  • validate-code

Decision drivers

  • ✅ Code review — No blockers (No AI review summary)
  • ⚠️ Gate result — Not blocking (Advisory; not blocking this PR.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7459
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 100 registered-repo PR(s), 49 merged, 5 issue(s).
Contributor context ✅ Confirmed Gittensor contributor lourincedaging0-commits; Gittensor profile; 100 PR(s), 5 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: lourincedaging0-commits
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 100 PR(s), 5 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-code)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ci): lint-composite-actions.mjs has no unit-test seam despite being the only structural validator for .github/actions/**

1 participant